package SL.bdqn.Service.impl;

import SL.bdqn.dao.Factory.UserDaoFactory;
import SL.bdqn.dao.UserDao;
import SL.bdqn.dao.impl.UserDaoImpl;
import SL.bdqn.entity.User;

public class UserServiceImpl {
    private UserDao dao = new UserDaoImpl();
//通过工厂获取所依赖的UserDao对象
    private UserDao userDao = UserDaoFactory.getInstance();

    public void save(User user){
        dao.save(user);
    }

    /**
     * 保存用户信息
     */
    public void save2(User user){
        //调用User的方法保存用户信息
        userDao.save(user);
    }

}
